using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;

namespace SkyShell.ViewModel
{
    /// <summary>
    /// This class contains properties that the main View can data bind to.
    /// <para>
    /// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
    /// </para>
    /// <para>
    /// You can also use Blend to data bind with the tool's support.
    /// </para>
    /// <para>
    /// See http://www.galasoft.ch/mvvm
    /// </para>
    /// </summary>
    public class MainViewModel : ViewModelBase
    {
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel()
        {

            //cut and paste this line to your ctor
            _closeWindow = new RelayCommand(ExecCloswWindow, CanCloswWindow);

            ////if (IsInDesignMode)
            ////{
            ////    // Code runs in Blend --> create design time data.
            ////}
            ////else
            ////{
            ////    // Code runs "for real"
            ////}
        }

        
		private RelayCommand _closeWindow;
		public RelayCommand CloswWindow
		{
			get
			{
				return _closeWindow;
			}
		}
    
		/// <summary>
		/// Checks whether the CloswWindow command is executable
		/// </summary>
		private bool CanCloswWindow()
		{
			return true;
		}
        
		/// <summary>
		/// Executes the CloswWindow command 
		/// </summary>
		private void ExecCloswWindow()
		{
            App.Current.Shutdown();
		}
  

    }
}